import { GET_ROLES_LIST_API } from "@/api";
import { mobxState } from "@/data";
import { http } from "@/utils";

/**
 * @description 加载更新角色列表到mobx缓存
 */
const loadRoleList = () => {
    if (sessionStorage.token) {
        http.get({
            url: GET_ROLES_LIST_API,
            params: {
                current: 1,
                pageSize: 1000,
            },
            success: (res) => {
                mobxState.updateAllRoles(res?.data?.list);
            }
        })
    }
}
export default loadRoleList;